package com.mymoney.utils;

public class ComparisonUtils {

	public static boolean areEqual(String str1, String str2) {

		if ( str1 != null && str2 == null && str1.length() > 0) {
			return false;
		}

		if (str2 != null && str1 == null && str2.length() > 0) {
			return false;
		}

		if ((str1 == null || str1.length() == 0) && (str2 == null || str2.length() ==0) ) {
			return true;
		}

		return str1.equals(str2);
	}

	public static boolean areDifferentToNull(Object obj1, Object obj2) {
		if (obj1 == null ^ obj1 == null) {
			return true;
		}
		return false;
	}

	public static boolean areBothNull(Object obj1, Object obj2) {
		if (obj1 == null && obj2 == null) {
			return true;
		}
		return false;
	}
}
